//
//  WeightListViewController.h
//  IWeighMyself
//	Abstract: Lists the weight entries
//
//  Created by Francisco Gindre on 8/24/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "WeightEntryCell.h"
#import "IWeighMyselfAppDelegate.h"


@interface WeightListViewController : UITableViewController {
	NSMutableArray *entries;
	
	//reusable cell to display the weight entries
	
	WeightEntryCell *weightEntryCell;
	
	//appdelegate
	IWeighMyselfAppDelegate *appDelegate;
	
	
	// dates that mark the time interval described by this weight list
	NSDate * initialDate;
	NSDate * endingDate;
}
@property (nonatomic,retain) NSMutableArray *entries;
@property (nonatomic,retain) IBOutlet WeightEntryCell *weightEntryCell;
@property (nonatomic,retain) IWeighMyselfAppDelegate *appDelegate;
@property (nonatomic,retain) NSDate * initialDate;
@property (nonatomic,retain) NSDate * endingDate;

-(id)initWithDateRange:(NSDate*)fromDate to:(NSDate*)endDate ;

/**
 ViewController gets notified the user changed the values by editing the entry. The entries need to be refreshed from database
 
 */
-(void)userEditedValue;

/**
 load the entries from database within a date range
 */

-(void)loadEntriesFromDatabase:(NSString*)dbPath startingDate:(NSDate*)fromDate EndDate:(NSDate*)endDate;

@end
